'''
Created on 2010-3-2

@author: Administrator
'''
import sys
from jolly.datastructures.AbstractMethod import AbstractMethod
from jolly.datastructures.Object import Object

class Cursor(Object):
    '''
    Base class from which all cursor classes are derived.
    '''


    def __init__(self,list):
        '''
        (Cursor)->None
        Constructor.
        '''
        super(Cursor, self).__init__()
        self._list=list
    
    def getDatum(self): pass
    getDatum = AbstractMethod(getDatum)
    datum = property(fget=lambda self: self.getDatum())
    
    def insertAfter(self, obj): pass
    insertAfter = AbstractMethod(insertAfter)
    
    def insertBefore(self, obj): pass
    insertBefor = AbstractMethod(insertBefore)
    
    def withdraw(self, obj): pass
    withdrwa = AbstractMethod(withdraw)
    
    def _compareTo(self, obj):
        '''
        (Cursor, Cursor)->int
        Compares this cursor with the given cursor.
        '''
        assert isinstance(self, obj.__class__)
        raise NotImplementedError
    
    @staticmethod
    def main(*argv):
        "Cursor test program."
        print Cursor.main.__doc__
        return 0

if __name__ == "__main__":
    sys.exit(Cursor.main(*sys.argv))
        